package component.display_component;

import Resources.sResources;
import java.awt.Component;
import panel.dialog.FindWindow;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Rabid
 */
public class sSelectBox extends javax.swing.JPanel {

    /**
     * Creates new form sSelectBox
     */
    public sSelectBox() {
        initComponents();
        initOthers();
    }

    public static Component getCode(){
        return stxtCode;
    }
    
    public static void setCode(String value){
        stxtCode.setText(value);
    }
    
    public static Component getDescription(){
        return stxtDescription;
    }
    
    public static void setDescription(String value){
        stxtDescription.setText(value);
    }
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    private void initOthers() {
        sbtnSelect.setIcon(sResources.getIcon(sResources.BROUSE));
        stxtDescription.setEditable(false);
    }
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        stxtCode = new javax.swing.JTextField();
        sbtnSelect = new javax.swing.JButton();
        stxtDescription = new javax.swing.JTextField();

        stxtCode.setMinimumSize(new java.awt.Dimension(6, 23));
        stxtCode.setPreferredSize(new java.awt.Dimension(59, 23));

        sbtnSelect.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                sbtnSelectActionPerformed(evt);
            }
        });

        stxtDescription.setBackground(new java.awt.Color(248, 255, 224));
        stxtDescription.setPreferredSize(new java.awt.Dimension(59, 23));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(stxtCode, javax.swing.GroupLayout.DEFAULT_SIZE, 67, Short.MAX_VALUE)
                .addGap(0, 0, 0)
                .addComponent(sbtnSelect, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, 0)
                .addComponent(stxtDescription, javax.swing.GroupLayout.DEFAULT_SIZE, 207, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(stxtCode, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addComponent(sbtnSelect, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addComponent(stxtDescription, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
    }// </editor-fold>//GEN-END:initComponents

    private void sbtnSelectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sbtnSelectActionPerformed
        findWindow = new FindWindow(null, true);
        findWindow.setVisible(true);
    }//GEN-LAST:event_sbtnSelectActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton sbtnSelect;
    private static javax.swing.JTextField stxtCode;
    private static javax.swing.JTextField stxtDescription;
    // End of variables declaration//GEN-END:variables
    private FindWindow findWindow;
}
